<template>
  <div>
    <el-table :data="list"
              element-loading-text="Loading"
              border
              fit
              highlight-current-row>
      <el-table-column align="center"
                       label="订单编号"
                       width="170">
        <template slot-scope="scope">
          {{ scope.row.id }}
        </template>
      </el-table-column>
      <el-table-column label="用户ID"
                       width="170"
                       align="center">
        <template slot-scope="scope">
          {{ scope.row.user_id }}
        </template>
      </el-table-column>
      <el-table-column label="评价"
                       align="center">
        <template slot-scope="scope">
          <div class="demo-image">
            <el-image style="width: 50px; height: 50px"
                      :src="scope.row.img_list"
                      fit="cover"></el-image>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="图片"
                       width="170">
        <template slot-scope="scope">
          <span>{{ scope.row.desc }}</span>
        </template>
      </el-table-column>
      <el-table-column label="评分"
                       width="170"
                       align="center">
        <template slot-scope="scope">
          <div class="block">
            <el-rate v-model="scope.row.star"
                     disabled></el-rate>
          </div>
        </template>
      </el-table-column>
      <el-table-column class-name="status-col"
                       label="评价时间"
                       width="300"
                       align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.add_time }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { GetEvaluation } from '@/api/evaluation'
export default {
  data () {
    return {
      list: []
    }
  },
  created () {
    this.initData()
  },
  methods: {
    initData () {
      GetEvaluation(1).then(res => {
        this.list = res.data
        console.log(res)
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>

<style>
</style>